﻿using NFL.DataAccess.Interface;
using NFL.DataModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NFL.DataAccess.Implementation
{
    public class DatabaseFactory : Disposable, IDatabaseFactory
    {
        private NFLDataEntities dataContext;

        public NFLDataEntities Get()
        {
            return dataContext ?? (dataContext = new NFLDataEntities());
        }

        protected override void DisposeCore()
        {
            if (dataContext != null)
                dataContext.Dispose();
        }
    }

}
